package com.itheima.socket.tcp.demo07;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerDemo07 {

    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = new ServerSocket(9797);
        Socket socket = serverSocket.accept();
        InputStream inputStream = socket.getInputStream();
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        String line = null;
        while ((line = bufferedReader.readLine()) != null){
            if (line.equals("886")){
                break;
            }
            System.out.println(line);
        }
        socket.close();
        serverSocket.close();
    }
}
